package team.epos.merchant.service;

import team.epos.merchant.dao.BaseInfoDao;
import team.epos.utils.pojo.Dishes;
import team.epos.utils.pojo.Store;

import java.util.TreeMap;

/**
 * @author CHENKI
 */
public class BaseInfoServiceImpl implements BaseInfoService {
    private BaseInfoDao baseInfoDao = new BaseInfoDao();

    @Override
    public Store findBaseInfo(Integer id) {
        Store store = null;
        store = (Store) baseInfoDao.getById(Store.class, id.intValue());
        return store;
    }

    @Override
    public int updateBaseInfo(Store store) {
        int i = 0;
        if (store.getStoreImg() == null || store.getStoreImg1() == null) {
            i = baseInfoDao.updateByCondition(store);
        } else {
            i = baseInfoDao.update(store);
        }

        return i;
    }
}